var express = require('express');
var app = express();
var routar = require('./routar/routar.js');
var session = require('express-session');

app.use(express.static('./public'));
app.use('/avatar',express.static('./avatar'));
app.set('view engine','ejs');
app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true
}));
//路由表
//页面展示
app.get('/',routar.showIndex);
app.get('/regist',routar.shouRegist);
app.get('/login',routar.showlogin);
app.get('/setavatar',routar.showsetavatar);
app.get('/myfabu',routar.showmyfabu);
//ajax请求
app.post('/doregist',routar.doregist);
app.post('/dologin',routar.dologin);
app.post('/dosetavatar',routar.dosetavatar);
app.post('/dopostcontent',routar.dopostcontent);
app.get('/contentlist',routar.getcontentlist);
app.get('/getmyfabu',routar.getmyfabu);



app.listen(3000);